package org.jeecg.modules.wangyue.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.wangyue.entity.UserRoleInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.wangyue.model.res.ResUserRoleInfoModel;
import org.springframework.stereotype.Component;

/**
 * @Description: 角色信息表
 * @Author: jeecg-boot
 * @Date:   2023-06-30
 * @Version: V1.0
 */
@Component
public interface UserRoleInfoMapper extends BaseMapper<UserRoleInfo> {

    IPage<ResUserRoleInfoModel> queryJsUserRoleInfo(@Param("page") Page page,
                                                    @Param("keywords") String keywords,
                                                    @Param("userId") String userId,
                                                    @Param("cityCode") String cityCode,
                                                    @Param("log") String log,
                                                    @Param("lat") String lat,
                                                    @Param("distance") String distance,
                                                    @Param("serviceNum") String serviceNum,
                                                    @Param("sex") String sex,
                                                    @Param("yearMax") String yearMax,
                                                    @Param("yearMin") String yearMin,
                                                    @Param("serviceTypeCode") String serviceTypeCode,
                                                    @Param("serviceItemsCode") String serviceItemsCode,
                                                    @Param("sortType") String sortType,
                                                    @Param("dateStr") String dateStr);

    String computeDistanceFromJs(@Param("log") String log,
                                 @Param("lat") String lat,
                                 @Param("jsUserId") String jsUserId,
                                 @Param("jsUserType") String jsUserType);


    IPage<UserRoleInfo> queryUserRoleInfoByPage(@Param("page") Page page,
                                                @Param("userType") String userType,
                                                @Param("keywords") String keywords);

    IPage<UserRoleInfo> queryJsRoleInfoByPage(@Param("page") Page page,
                                              @Param("userType") String userType,
                                              @Param("keywords") String keywords,
                                              @Param("isRoleAuth") String isRoleAuth);

    List<UserRoleInfo> queryUserRoleInfoByList(@Param("userType") String userType,
                                               @Param("idList") List<String> idList,
                                               @Param("keywords") String keywords);

    List<UserRoleInfo> queryJsRoleInfoByList(@Param("userType") String userType,
                                             @Param("idList") List<String> idList,
                                             @Param("keywords") String keywords,
                                             @Param("isRoleAuth") String isRoleAuth);

    UserRoleInfo queryOneForUpdate(@Param("userId") String userId,
                                   @Param("userType") String userType);

    List<UserRoleInfo> queryListForUpdate(@Param("userIdList") List<String> userIdList,
                                          @Param("jsIdList") List<String> jsIdList);


}
